package com.zwz.control;

import com.zwz.bean.FunctionSwitch;
import com.zwz.control.utils.Result;
import com.zwz.utils.MessageUtil;
import com.zwz.utils.TcpServer;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/camera")
public class CameraController {


    @PutMapping("/updateGuanhao/{guanhao}")
    public Result updateGuanhao(@PathVariable String guanhao) {
        System.out.println(guanhao);
        MessageUtil.guanhao = guanhao;
        return Result.success("操作成功！！");
    }

    @PutMapping("/updateGuanhaoCorrectStatus")
    public Result updateGuanhaoCorrectStatus(@RequestBody FunctionSwitch functionSwitch) {
        TcpServer.guanhaoCorrectStatus = functionSwitch.getGuanhaoCorrectStatus();
        return Result.success("操作成功！！");
    }

    @PutMapping("/updateBoxCodeInferStatus")
    public Result updateBoxCodeInferStatus(@RequestBody FunctionSwitch functionSwitch) {
        System.out.println(functionSwitch.getBoxCodeInferStatus());
        TcpServer.boxCodeInferStatus = functionSwitch.getBoxCodeInferStatus();
        return Result.success("操作成功！！");
    }
}
